update file protocol to return as callback