move autohieght to method