WriteHandler string to integer bug fix