add header() function to redirect to login page