finally got login to work properly