check dependencies (and use db) in the last place