fixes crash patch by (Mark Hills <mark at pogo dot org dot uk>)