Received Unwarranted $1000 Bonus

I received a bonus for hiring a new employee for $1,000, but then a paycheck later, my company sent another $1,000 by mistake. I let my company know of this mistake this morning. Thoughts? Did I do the right thing?