Fixed io issue and added a method for killing frames (layouts)