fixed error with sin and cos