Changed login, more flexible