added wrap and end , not working properly