scope fixed. Done: added annonymous function