minor bugs
add event to track outbound links
move code around