Added check to make sure that post type is set for the current post