bug fixing and testing