wrapping timeout in $timeout