added bit more inteligent data passing via jQuery