fixing automatic period detection, bitch