changing type of context so it doesn't have to be cast for closing