Login data is now validated, fixed bug in is_valid_login and database being closed after init