rolled back to older gems and added back in authenticate_user