Put check for frameElement inside try block