*fix exception handling
*added gui func