Trying to fix writepage