Replace 'name' by 'username'

function.name is not allowed in js