fix sin and cos mode bug