fixed bug with keep statement