more flexible database checking in case userid = 1 is non existent