changed the order of checks in getfiles.m