Implemented login properly