working on master detail thing
finally a working app