Function to check if user filled in correct password