Fixing bug on edges movement