db calls now atomic, checks now working