Man accidentally shoots himself in the head