Added partial code to handle login