Fixed a little bug in createFrame