magic numbers check fixed