Add safety check

Signed-off-by: Andre Schweiger <andre.spiele@yahoo.de>