added an unbind to the window resize function in list directive. refactored the code a bit