bug fixing on guest functions