update to use EXIST rather than COUNT