Fixed wrong check