Added input checks in filesystemhandler