did some debugging on write_storage()