fixed bug that crashed