better transactional handling+db update?