bugfix in updatefunction