updated code for method overload