You played it correctly. Bad beats are just a part of poker. Just keep playing good cards.