some more bug fixing