can bacterial infection cause irregular periods