Fixed bug in service registration