Fixed the bug of ignoring shell.replace return value.