some bug fixing