added loading animation and auto redirect if user is already logged in