fix bugs from last commit