better place for that defer