Added assert

Also made read use assert