Working login controller