Added function addPatroller in Javascript