check that attach is legal before proceeding