Added a type check for gap parameter