Fixed a problem where assetion condition was wrong