Now validating flags for user id - may need to upgrade to transaction instead of queries