Added code for updatng layer position