fixed bug in getTheta