added login check for admin and student