fix #69, we can now pass stuffs in onEnd + tests added