fixed TODO: moved empty check outside decorator