Command executed doesn't wait for stdin from shell