Added listener which runs method beforeSetup before setup of the canvas
and afterSetup after creation of the canvas