fixed template and added checking for network operation result