fixed mode function bug