but according to these records , the captain and crew deliberately sank the ship in a deserted cove , planning to come back later and retrieve the treasure , but they were attacked and killed by pirates before they could return .