Function working passing this as a paramete