added additional check for user login correctness