minor logic updates. fixed import error on invalid user.