fix prime func