adapted to accept a option object