added getRect method