fixed some readonly bugs