Fixed wrong Task usage;
Added correct exception handling