adding helper method for attaching events to support IE8