added error logging and basic initializers