minor bug fix in assertion for safety