write error fixed