calling trackevent first

another attempt for #267