Fixed invalid write