Non-static function bug fix