added error handling, plus ui mods