Fix error causing crashing