make sure to free context in all paths