populate form on edit sorted