fix exec handler; add tests for exec handler