added function to support user login