updated build script with some redirection