Fix bugs in popbox service script