fixed bugs by dynamic size of frame