error check before creating collections