Fixed a bug which prevented drawLayers() from being called within an event callback