initial bug fixing