adding serialize method