fixed scriptsdir path duplication. Fixed missing trim