first remove on error resume next, so if any error occurs earlier in the code it will not be hidden