fix bugs that run on rails