Update functions.php

BUGFIX items overlap check failed if item2 was older