Redirecting to database