added new way to handle gui