fixed bug in camera reading code