minor bug fixes with logging in, and permissions