Improved log in check