Fixed the final bug