Added thread pool for PhantomJS
use new Error() instead of strings