Changed order of read/write and added log message