fixed %% bug