Fixed null bug on the fetch data method