Improved the remote IP check