adding better checking