dependency missing - added
refactored check and added unit tests