misc bug fixes and added error popup