Stack overflow error solution step 1