fixed setting read only variables causing an uncaught exception