added new functions in model & Login flow