Added offline handling to login and signup