How To Add An Allow Rule To UFW’s before*.rules

I’ve appended to my /etc/ufw/before6.rules file the following

-A ufw6-before-input -p tcp -s XX.XX.XXX.XX -j ACCEPT
-A ufw6-before-input -p tcp -d XX.XX.XXX.XX -j ACCEPT

but still am not able to successfully connect without disable the ufw firewall.