added some basic errorhandling