Still issies with funciton as local