Aswer for question http://stackoverflow.com/questions/24679037