amended checking for the client being called