controller done in typescript