Ideally we should set loading to false here as well