corrected minor bug in check