fix the targetHeight calc error

I have pushed an issues, see the issues for detail