check function + store in DB