fixed bug that was caused by previous bug fix