fix dependencies and use flags