Added guarding to AI