added err to callbacks