add max_height limit, fix bug fullscreen loop