fixed final bugs