fix height issue and use dry code