added when method

Signed-off-by: Filiberto Cota <filiberto.cota@gmail.com>