data is null when invalid, not undefined
number type for size input
error alert
added var defs, semicolons, removed commas, standard cleaning
check for errors and emit, handle emit with alert on client
additional logging