changed errorhandlings try/catch for some stuff