fix max height init value being wrong in some cases. also try one more time in onPause to read the value.