added var to for...in loop. oops.
set up error messages on the front end.