Updated safeMove logic