fixed mistake(still really buggy)