Added exceptionhandling