implemented random post feature and refined the controller