Fixed fetching function