Added check to throw error on failed remap