fixing undefined offset issue on user/login