add selected function for currently selected post
add session set post_id to null at start