convert Hook.js to Hook.cs and fix bug hooking when moving