Fix bug in service handler