Moved to callback routine, main code is lighly nicer and more easy to understand