add additional error check
add additional error check

RWTH-OS/HermitCore,RWTH-OS/HermitCore,RWTH-OS/HermitCore,RWTH-OS/HermitCore,stlankes/HermitCore,RWTH-OS/HermitCore,stlankes/HermitCore,stlankes/HermitCore,RWTH-OS/HermitCore,stlankes/HermitCore,stlankes/HermitCore,stlankes/HermitCore