bug fixing

fixing bug with null when list is empty
Merge pull request #6 from dredasty/master

critical bug fixing