complete fix for all functions