resolve some minor bugs but wp still behaving weird on second write