Fix deprecated call to get context function