Use @nek4life's approach of pulling username and password check out of the loop.