fixed missing var, posts.js cleanup