comment out var dir to see if jquery is at fault