sorted out login authentication