before merge with readline