fixed bugs and improved uicreating mechanism

ehhhhhhhh..