Updated to handling login