fixed the final bug