Added check prime function