added error handling and defaults for new users