added close condition
fixed open condition