few more fixes/ logical errors