fixed a bug in the wrapper script