finish login function
minor changes on error pages