fix variable name
improve prompt detection regexp