Fixed bug causing file to be unnecessarily re-written on every request.