added 'else' blocks