added the ensure_logged_in and current_user methods