added security check