Fixed bug from debugging