[Experiemental] error checking and variable tweaks