fix weird bug with height calculation, fix #3