Prevent security error with try catch block Closes #5275