fixed errors with list implementation