Fixed bug in passing the context