bug fix: did not check if file was created on '+' mode