Change getRect method to update method