Fix task creation functionality, add logging