Added context for handlers
Fixed flags
Restored functionality of master branch