Removing deprecated promise 'pipe' with 'then'
Adding validations that clientID exists before using it.