checking if username and password has been set, thanks Max