added try-catch exception to view error