Added check for third argument