fixed a bug on services.js