further bug fixing