add code for autolayout