fix bugs before merging