Made the AI handle messages a bit better