small fix for case when chain is empty