you did not kill them rather it was allah who killed them and you did not throw when you threw rather it was allah who threw that he might test the faithful with a good test from himself. indeed allah is allhearing allknowing.
فلم تقتلوهم ولكن الله قتلهم وما رميت إذ رميت ولكن الله رمى وليبلي المؤمنين منه بلاء حسنا إن الله سميع عليم