Fixed move function