added some spaghetti code for closing projects