add the new method for set frame and return height