add callbacks to file methods