Added callbacks
Added states to xml