fix none type exception in login form