added auto-assignment feature