fixed bug in optimize when user has it disabled