performance and bug fixing