Fixes logging to append to file