fixed bug in add problem function