fixed code to create list