debugged index trim in validation