fixed a huge bug