final bug fixing