Removing duplicate code block
Adding better checks for service name when adding/editing