fix bug in directory check - variable missing $ tag
changed phantomjs to install only in it isn't present