doing some bug fixing