Fix for fatal PHP error (try-catch block required)