fix bugs and implement customer type change