Added another check to verify that a mesh has been selected