Ticket Automatically Created from Closed Chat

Ticket Automatically Created from Closed Chat

Is there a way to prevent a ticket being create for every chat.... or at the very least have it automatically closed.