Switched to using global $commit