fixed bug in the autopopulation