added directory as parameter, improved deploy