fixed bug with 'nil' handling