created user_active() function