fixing the list code