Knew there woudld be weird conditions with getting the cur pid.