removed unused function
added error handling in gui