fixed issue if data is empty