changed function loading to use a check for function existance instead of reuqire_once