update file protocol to return as callback
better error message