fixing insert statement

Not positive that this is the correct logic but without this the module and related states break