Clearing code and adjust in avatar's position