fixed check misspents function