added gui as parameter in method call