Update functions.php

Fixed broken function