fixed c89 compatibility