added createCommandRejectedEvent function