Fixed error when used on other post_type than the specified one.