added more casts with bool