fixed 'cannot get [0] of null', beautified
added filter functionality