solution to the list items jumping around problem