Added filtering by state_in, and fixed submission