merged and bug fixed