fix plot bug