Added more error control in loadActions