Move post_modified shift inside conditional