Removed write head calls on error