Fix for old browsers which do not support beginEvent & endEvent events