Add atomic keyword to query delete