move the jQuery stuff into a directive