Fixed error in debug mode