fixed stupid function bug.