added check if $post is available