fixed task bug causing the app to crash