fixed some errorhandling when creating devices